package cn.i96688.scanclient.ui;

import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

public class SuperForm extends javax.swing.JFrame implements ActionListener,MouseListener{

	private static final long serialVersionUID = 7643757307621955769L;

	public void showForm(){
		 //获取屏幕大小
	    Dimension screenSize =Toolkit.getDefaultToolkit().getScreenSize();
	    //让窗口居中显示 
	    Rectangle rect = getBounds();
	    int width=(screenSize.width-rect.width)/2;
	    int height=(screenSize.height-rect.height)/2;
	    setLocation(width,height);
	    //...
//	    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	    this.show(true);
	}
	@Override
	public void mouseClicked(MouseEvent e) {
	}

	@Override
	public void mousePressed(MouseEvent e) {
	}

	@Override
	public void mouseReleased(MouseEvent e) {
	}

	@Override
	public void mouseEntered(MouseEvent e) {
	}

	@Override
	public void mouseExited(MouseEvent e) {
	}

	@Override
	public void actionPerformed(ActionEvent e) {
	}
	
	

}
